<!DOCTYPE html>
<!-- saved from url=(0046)http://danci.yfhl.net:8080/dcsj/web/userCenter -->
<html lang="zh">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

		<title>校笑效单词学习系统</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta name="keywords" content="校笑效单词学习系统">
		<meta name="description" content="校笑效单词学习系统">
		<link rel="shortcut icon" href="http://danci.yfhl.net:8080/dcsj/static/web/favicon.ico">
		<link rel="stylesheet" href="./单词学习系统用户中心_files/reset.css">
		<link rel="stylesheet" href="./单词学习系统用户中心_files/bootstrap.min.css">
		<link rel="stylesheet" href="./单词学习系统用户中心_files/iconfont.css">
		<link rel="stylesheet" href="./单词学习系统用户中心_files/style.css">
		<script src="./单词学习系统用户中心_files/hm.js.下载"></script>
		<script src="./单词学习系统用户中心_files/jquery-1.12.4.min.js.下载"></script>
		<script src="./单词学习系统用户中心_files/bootstrap.min.js.下载"></script>
		<script src="./单词学习系统用户中心_files/layer.js.下载"></script>
		<link rel="stylesheet" href="./单词学习系统用户中心_files/layer.css" id="layuicss-skinlayercss">
		<script src="./单词学习系统用户中心_files/laydate.js.下载"></script>
		<link rel="stylesheet" href="./单词学习系统用户中心_files/laydate.css" id="layuicss-laydate">
		<script src="./单词学习系统用户中心_files/jquery.validate.min.js.下载"></script>
		<script src="./单词学习系统用户中心_files/messages_zh.js.下载"></script>
		<script src="./单词学习系统用户中心_files/script.js.下载"></script>
	</head>

	<body rlt="1" style="">
		<div class="body-bg"></div>
		<div class="header">

			<div class="container">
				<div class="row">
					<div class="col-sm-1-5">
						<a href="" class="pull-left logo">
							<div class="middle-box">
								
							</div>
						</a>
					</div>
					<div class="col-sm-4-5">
						<ul class="nav">
							<li class="active">
								<a href="" t_href="">首页</a>
							</li>
							<li>
								<a href="" t_href="">单词PK赛</a>
							</li>
							<li>
								<a href="" t_href="">排行榜</a>
							</li>
							<li>
								<a href="" t_href="#">兴趣听力</a>
							</li>
							<li>
								<a href="" t_href="#">倍速阅读</a>
							</li>
							<li>
								<a href="" t_href="#">通关语法</a>
							</li>
							<li>
								<a href="" t_href="">南开商城</a>
							</li>
						</ul>
					</div>
				</div>
			</div>

		</div>
		<div class="main">
			<div class="container">
				<div class="row">
					<div class="col-sm-12">
						<div class="main-content">
							<div class="container-mid margin-b-100">
								<div class="title-line">
									<h3>用户中心</h3></div>
								<div class="box-shadow padding-40-60">
									<form id="formInfo" class="form-horizontal" action="http://danci.yfhl.net:8080/dcsj/web/userCenter" method="post" novalidate="novalidate">
										<div class="fieldset">私人信息</div>
										<div class="row form-group">
											<div class="col-sm-6">
												<label class="form-label space2"><span>姓</span>名：</label>
												<div class="control-block">
													<input id="name" name="name" placeholder="请输入姓名" class="form-control required" disabled="disabled" type="text" value="校笑效" maxlength="50">
												</div>
											</div>
											<div class="col-sm-6">
												<label class="form-label space2"><span>性</span>别：</label>
												<div class="control-block">
													<select id="sex" name="sex" class="form-control required">	
														<option value=""></option>
														<option value="3">保密</option>
														<option value="1">男</option>
														<option value="2" selected="selected">女</option>
													</select>
												</div>
											</div>
										</div>
										<div class="row form-group">
											<div class="col-sm-6">
												<label class="form-label space2"><span>年</span>龄：</label>
												<div class="control-block">
													<input id="age" name="age" placeholder="请输入年龄" class="form-control" required="required" type="text" value="0">
												</div>
											</div>

											<div class="col-sm-6">
												<label class="form-label">用户状态：</label>
												<div class="control-block">
													<select id="status" name="status" class="form-control" disabled="disabled">
														<option value="1" selected="selected">付费</option>
														<option value="2">未付费</option>
													</select>
												</div>
											</div>
										</div>
										<!-- <div class="row form-group">
											
										</div> -->
										<div class="dividing-line"></div>
										<div class="fieldset">联系方式</div>
										<div class="row form-group">
											<div class="col-sm-6">
												<label class="form-label">邮箱地址：</label>
												<div class="control-block">
													<input id="email" name="email" placeholder="请输入邮箱地址" class="form-control email" type="text" value="" maxlength="100">
												</div>
											</div>
											<div class="col-sm-6">
												<label class="form-label space2-en"><span>QQ</span>号：</label>
												<div class="control-block">
													<input id="qqNum" name="qqNum" placeholder="请输入QQ帐号" class="form-control" type="text" value="" maxlength="20">
												</div>
											</div>
										</div>
										<div class="row form-group">
											<div class="col-sm-6">
												<label class="form-label space3"><span>微信</span>号：</label>
												<div class="control-block">
													<input id="weixin" name="weixin" placeholder="请输入微信号" class="form-control" type="text" value="" maxlength="50">
												</div>
											</div>
											<div class="col-sm-6">
												<label class="form-label">电话号码：</label>
												<div class="control-block">
													<input id="phone" name="phone" placeholder="请输入电话号" class="form-control" type="text" value="" maxlength="20">
												</div>
											</div>
										</div>
										<div class="row form-group">
											<div class="col-sm-6">
												<label class="form-label">手机号码：</label>
												<div class="control-block">
													<input id="mobile" name="mobile" placeholder="请输入手机号码" class="form-control required" disabled="disabled" type="text" value="" maxlength="20">
												</div>
											</div>
										</div>
										<!-- <div class="dividing-line"></div> -->

										<div class="dividing-line"></div>
										<div class="text-center">
											<button type="submit" class="btn btn-warning btn-mid">保存</button>
											<br>
											<button type="button" id="btnChangePassword" class="btn btn-hollow btn-mid">修改密码</button>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div id="changePassword" class="layer-content">
			<button type="button" id="btnCloseLayer"><i class="iconfont iconclose"></i></button>
			<div class="layer-content-box padding-40">
				<div class="title">修改密码</div>
				<form action="http://danci.yfhl.net:8080/dcsj/web/userCenter" method="" id="formPassword" novalidate="novalidate">
					<div class="form-group">
						<label class="form-label">原始密码：</label>
						<div class="control-block">
							<input type="password" class="form-control" name="oldPassword" placeholder="原始密码" required="required">
						</div>
					</div>
					<div class="form-group">
						<label class="form-label space3"><span>新密</span>码：</label>
						<div class="control-block">
							<input type="password" class="form-control" id="newPassword" name="newPassword" placeholder="新密码" required="required">
						</div>
					</div>
					<div class="form-group">
						<label class="form-label">确认密码：</label>
						<div class="control-block">
							<input type="password" class="form-control" id="confirmPassword" name="confirmPassword" placeholder="确认密码" required="required">
						</div>
					</div>
					<div class="text-center">
						<button type="submit" class="btn btn-warning btn-mid">保存</button>
					</div>
				</form>
			</div>
		</div>
		<script type="text/javascript">
			$(function() {
				// 初始化时间
				laydate.render({
					elem: '#regDate',
					max: 0
				});

				// 个人信息提交
				$('#formInfo').validate({
					rules: {
						age: { digits: true },
						email: { email: true },
						//phone: {isLandline: true},
						mobile: { isMobile: true }
					},
					messages: {
						age: { digits: '请输入正确的年龄' },
						email: { email: '请输入正确的邮箱地址' },
						//phone: {isLandline: '请输入正确的座机号码'},
						mobile: { isMobile: '请输入正确的手机号码' }
					},
					submitHandler: function(form) {
						var arrayLs = new Array();;
						var i = 0;
						$(":disabled").each(function() {
							if($(this).attr("name") != "regDate") {
								$(this).attr("disabled", false);
								arrayLs[i] = this;
								i++;
							}
						})
						var data = $('#formInfo').serialize();
						console.info(data);
						for(var j = 0; j < arrayLs.length; j++) {
							$(arrayLs[j]).attr("disabled", true);
						}
						$.ajax({
							url: "/dcsj/web/upUser",
							method: "post",
							data: data,
							success: function(data) {
								if(data.success) {
									layer.alert(data.msg, function() {
										exit();
									});
								} else {
									layer.alert(data.msg);
								}

							}
						});
					}
				});

				// 修改密码
				$('#formPassword').validate({
					rules: {
						oldPassword: {
							minlength: 6,
							maxlength: 12
						},
						newPassword: {
							minlength: 6,
							maxlength: 12
						},
						confirmPassword: {
							minlength: 6,
							maxlength: 12,
							equalTo: "#newPassword",
						}
					},
					messages: {
						oldPassword: {
							minlength: '密码至少是6位',
							maxlength: '密码最多输入12位',
						},
						newPassword: {
							minlength: '密码至少是6位',
							maxlength: '密码最多输入12位',
						},
						confirmPassword: {
							minlength: '密码至少是6位',
							maxlength: '密码最多输入12位',
							equalTo: '两次输入的密码不一致，请核对',
						}
					},
					submitHandler: function(form) {
						$.ajax({
							url: "/dcsj/web/savePwd",
							method: "post",
							data: $('#formPassword').serialize(),
							success: function(data) {
								if(data.success) {
									layer.alert(data.msg);
								} else {
									layer.alert(data.msg);
								}

							}
						});
					}
				});

				// 修改密码
				$("#btnChangePassword").click(function() {
					layer.open({
						type: 1,
						title: 0,
						closeBtn: 0,
						area: '476px',
						content: $('#changePassword')
					});
				});
			});
		</script>

		<div id="qds" style="display:none;"></div>
	</body>

</html>